/**
 * Copyright (c) 2009-2011, chunquedong(YangJiandong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 
 * History:
 *     2010-05-05  Jed Young  Creation
 */
package chunmap.example.grid;

import chunmap.example.BaseMap;
import chunmap.model.elem.Envelope;
import chunmap.raster.grid.data.GridDataFactory;
import chunmap.view.layer.Layer;
import chunmap.app.MapCtrl;
/**
 * @author chunquedong
 * 
 */
public class GridLayerTest extends BaseMap{
	
	public static void main(String[] args) {

		GridLayerTest me = new GridLayerTest();
		me.init();
	}

	@Override
	protected void addLayer(MapCtrl map) {
		Layer layer = loadLayerData();
		map.getLayerCollection().add(layer);
	}

	private static Layer loadLayerData() {
		String rootPath = "D:\\Temp\\chunmapData";
		String parameters = "1267327509866";
		
		Envelope subEnvelop = new Envelope(92.37175137842411, 31.01897163866643,
				108.8716402641172, 44.2188827472209);
	
		GridDataFactory df = new GridDataFactory(rootPath, parameters,
				subEnvelop, 500, 400);
		Layer layer = df.createLayer();
		return layer;
	}
}